package servlet;

import bean.ShopBean;
import dao.UserDao;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;

@WebServlet(name = "ShowShopServlet", value = "/ShowShopServlet")
public class ShowShopServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");
        response.setCharacterEncoding("utf-8");//防止中文乱码

        String name=request.getParameter("name");
        request.getSession().setAttribute("search","0");//查询
        List<ShopBean> list=new UserDao().showShop("",name);
        request.getSession().setAttribute("list",list);
        response.sendRedirect("manage.jsp");

    }
}
